package com.zx.mvcframework.handle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ProjectName: myspring
 * @Package: com.zx.mvcframework.handle
 * @ClassName: InterceptorHandler
 * @Author: 1
 * @Description: 1
 * @Date: 2021/10/4 17:34
 */
public interface InterceptorHandler {

    /**
     *  处理程序 执行前拦截处理
     */
    default boolean preHandle(HttpServletRequest request, HttpServletResponse response, MethodHandler handler)
            throws Exception {

        return true;
    }

    /**
     *  处理程序执行后 拦截处理
     */
    default void postHandle(HttpServletRequest request, HttpServletResponse response, MethodHandler handler) throws Exception {
    }


    /**
     *    最终的处理 本简单框架 暂时无用
     */
    default void afterCompletion(HttpServletRequest request, HttpServletResponse response, MethodHandler handler) throws Exception {
    }

}
